package com.steve.summary.seata.feign;

import com.steve.summary.seata.entity.Account;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestParam;

import java.math.BigDecimal;

/**
 * @Author: STEVE
 * @Description: 账户服务Feign接口
 * @since: 2025-07-09
 */
@FeignClient(name = "account-service", path = "/account")
public interface AccountFeignClient {

    @PostMapping("/decrease")
    void decrease(@RequestParam("userId") String userId, @RequestParam("money") BigDecimal money);

    @PostMapping("/getByUserId")
    Account getByUserId(@RequestParam("userId") String userId);

    @PostMapping("/increase")
    void increase(@RequestParam("userId") String userId, @RequestParam("money") BigDecimal money);

}
